package com.funwell.server.constants;

/**
 * 端来源 APP:移动端,WEB:网页,WECHAT:微信
 * 
 * @author sunfangwei
 */
public enum SideEnum {

  /**
   * APP:移动端
   */
  APP("APP", "移动端"),
  /**
   * "WEB:"网页"
   */
  WEB("WEB", "网页"),
  /**
   * "WAP:"网页"
   */
  WAP("WAP", "H5"),
  /**
   * "WECHAT":"微信"
   */
  WECHAT("WECHAT", "微信");
  public String code;
  public String label;

  private SideEnum(String code, String label) {
    this.code = code;
    this.label = label;
  }

  /**
   * 是否为APP请求
   * 
   * @param code
   * @return
   */
  public static boolean isApp(String code) {
    return APP.code.equals(code);
  }

  /**
   * 是否为WEB请求
   * 
   * @param code
   * @return
   */
  public static boolean isWeb(String code) {
    return WEB.code.equals(code);
  }

  /**
   * 是否为WECHAT请求
   * 
   * @param code
   * @return
   */
  public static boolean isWechat(String code) {
    return WECHAT.code.equals(code);
  }
}
